<?php
include_once ("httpsqs/httpsqs_client.php");
$httpsqs_host = "localhost";
$httpsqs_port = "1218";
$httpsqs_auth = "";
$httpsqs_charset = "utf-8";

$httpsqs = new httpsqs($httpsqs_host, $httpsqs_port, $httpsqs_auth, $httpsqs_charset);
$dtn_status = "RUNNING";
$dtn_action = "STOP";
$bundle_stats = "DTN is not running.";
/*
1. check wheather dtn is running

*/
if ($_GET["status"] == "START") {
	$result = $httpsqs->put("php_python_request", "start");
	sleep(1);
	$result = $httpsqs->get("php_python_reply");
} else
	if ($_GET["status"] == "STOP") {
		$result = $httpsqs->put("php_python_request", "stop");
		sleep(1);
		$result = $httpsqs->get("php_python_reply");
	}
	
header("Location: dtncontrol.php");

?>